<?php
class BookCategory extends EnhancedModel {
    static $attr_protected = array("id");
    
    static $validates_uniqueness_of = array(
        array('name')
    );

    static $validates_length_of = array(
        array('name','minimum' => 1,'too_short' => 'is too short')
    );
    
    static $has_many = array(
        array('books','foreign_key' => 'category_id')
    );
}
?>
